/* Modern AI-themed dark interface */
:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e2d;
  --bg-tertiary: #2a2a3a;
  --accent-primary: #6e4ff6;
  --accent-secondary: #9179f0;
  --accent-tertiary: #40bfff;
  --text-primary: #f5f5f5;
  --text-secondary: #c0c0cc;
  --text-muted: #8a8aa0;
  --border-color: #343452;
  --success-color: #0acf97;
  --warning-color: #f9bc0b;
  --error-color: #fa5c7c;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --glow-effect: 0 0 15px rgba(110, 79, 246, 0.3);
  --gradient-bg: linear-gradient(135deg, #2a2a3a 0%, #1e1e2d 100%);

  /* Aliases for commonly used variables */
  --primary-color: var(--accent-primary);
  --card-bg: var(--bg-secondary);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-secondary);
}

/* Layout */
.ldr-app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.ldr-sidebar {
  width: 240px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.ldr-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.ldr-sidebar-header h2 {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1.25rem;
  gap: 0.5rem;
  color: var(--accent-secondary);
}

.ldr-sidebar-header h2 i {
  color: var(--accent-primary);
}

.ldr-sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.ldr-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.ldr-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.ldr-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.ldr-sidebar-nav ul {
  list-style: none;
  position: relative;
}

.ldr-sidebar-nav li {
  margin-bottom: 0.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
  min-height: 52px; /* Ensures a reasonable clickable height */
}

.ldr-sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: inherit;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.ldr-sidebar-nav li i {
  width: 20px;
  color: inherit;
}

.ldr-sidebar-nav li:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.ldr-sidebar-nav li:has(a:focus) {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.ldr-sidebar-nav li a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.ldr-sidebar-nav li a:focus .ldr-nav-shortcut {
  background-color: var(--accent-primary);
  color: var(--text-primary);
}

.ldr-sidebar-nav li.active {
  color: var(--accent-primary);
  background-color: rgba(110, 79, 246, 0.1);
  border-left-color: var(--accent-primary);
}

.ldr-sidebar-nav li.active i,
.ldr-sidebar-nav li.active a {
  color: inherit;
}

/* Navigation shortcuts */
.ldr-nav-shortcut {
  margin-left: auto;
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
  transition: all 0.2s;
}

.ldr-sidebar-nav li:hover .ldr-nav-shortcut {
  background-color: var(--accent-primary);
  color: var(--text-primary);
}

.ldr-sidebar-nav li.active .ldr-nav-shortcut {
  background-color: var(--accent-primary);
  color: var(--text-primary);
}

.ldr-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ldr-nav-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  margin: 0;
}

.ldr-nav-hint kbd {
  background-color: var(--bg-tertiary);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.7rem;
  border: 1px solid var(--border-color);
}

/* Sidebar Sections */
.ldr-sidebar-section {
  margin-bottom: 1.5rem;
}

.ldr-sidebar-section-label {
  padding: 0.5rem 1.5rem 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.7;
}

.ldr-sidebar-section ul {
  margin-top: 0.25rem;
}

/* Nested sidebar items */
.ldr-sidebar-item--nested a {
  padding-left: 2.75rem;
}

/* Navigation text wrapper */
.ldr-nav-text {
  flex: 1;
}

/* Main Content */
.ldr-main-content {
  flex: 1;
  padding: 5rem 2rem 2rem 2rem; /* Top padding accounts for fixed top bar */
  margin-left: 240px;
  width: calc(100% - 240px);
  position: relative;
}

/* Top Bar with User Info and Logout */
.ldr-top-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 240px;
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
}

.ldr-top-bar-right {
  display: flex;
  align-items: center;
}

.ldr-user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ldr-user-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ldr-logout-form {
  display: inline;
}

.ldr-logout-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.ldr-logout-btn:hover {
  background-color: var(--error-color);
  color: white;
  border-color: var(--error-color);
  text-decoration: none;
}

/* Add padding to bottom of main content when log panel is visible */
.ldr-page#research-progress.active ~ .ldr-main-content,
.ldr-page#research-results.active ~ .ldr-main-content {
  padding-bottom: 42vh; /* Log panel max height + some extra */
}

.ldr-page {
  display: none;
}

.ldr-page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ldr-page-header {
  margin-bottom: 1.5rem;
}

.ldr-page-header h1 {
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--text-primary);
}

/* Cards */
.ldr-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.ldr-card-content {
  padding: 1.5rem;
}

/* Form Elements */
.ldr-form-group {
  margin-bottom: 1.5rem;
}

.ldr-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

textarea, input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 79, 246, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-secondary);
  box-shadow: var(--glow-effect);
  color: white;
}

.ldr-btn-outline {
  background-color: transparent;
  color: var(--accent-tertiary);
  border: 1px solid var(--accent-tertiary);
}

.ldr-btn-outline:hover {
  background-color: rgba(64, 191, 255, 0.1);
}

.ldr-delete-btn {
  color: var(--error-color);
  border-color: var(--error-color);
}

.ldr-delete-btn:hover {
  background-color: rgba(250, 92, 124, 0.1);
}

.ldr-terminate-btn {
  color: #e74c3c;
  border-color: #e74c3c;
}

.ldr-terminate-btn:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.ldr-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* Mode Selection */
.ldr-mode-selection {
  display: flex;
  gap: 1rem;
}

.ldr-mode-option {
  flex: 1;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1.25rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ldr-mode-option:hover {
  background-color: var(--bg-primary);
}

.ldr-mode-option.active {
  border-color: var(--accent-primary);
  background-color: rgba(110, 79, 246, 0.1);
}

.ldr-mode-icon {
  width: 40px;
  height: 40px;
  background-color: var(--accent-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ldr-mode-option.active .ldr-mode-icon {
  background-color: var(--accent-secondary);
  box-shadow: var(--glow-effect);
}

.ldr-mode-info h3 {
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.ldr-mode-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Progress Page */
.ldr-progress-info {
  padding: 1rem 0;
}

.ldr-current-query-container {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.ldr-current-query-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.5rem;
  min-width: 120px;
}

.ldr-current-query {
  flex: 1;
  color: var(--text-primary);
  padding: 0.5rem;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.ldr-progress-container {
  margin: 1.5rem 0;
  position: relative;
}

.ldr-progress-bar {
  width: 100%;
  height: 10px;
  background-color: var(--bg-tertiary);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.ldr-progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.ldr-progress-percentage {
  position: absolute;
  right: 0;
  top: -1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ldr-status-container, .ldr-task-container {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.ldr-status-label, .ldr-task-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.5rem;
  min-width: 120px;
}

.ldr-status-indicator {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ldr-status-indicator.ldr-status-completed {
  background-color: rgba(10, 207, 151, 0.2);
  color: var(--success-color);
}

.ldr-status-indicator.ldr-status-failed,
.ldr-status-indicator.ldr-status-error {
  background-color: rgba(250, 92, 124, 0.2);
  color: var(--error-color);
}

.ldr-status-indicator.ldr-status-in_progress {
  background-color: rgba(64, 191, 255, 0.2);
  color: var(--accent-tertiary);
}

.ldr-task-text {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.4;
}

.ldr-progress-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* Notification settings and audio test button */
.ldr-notification-settings {
  margin: 15px 0;
  display: flex;
  justify-content: flex-end;
}

.ldr-audio-test {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ldr-audio-test .ldr-tooltip-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 10px;
}

#test-audio-btn {
  padding: 5px 10px;
  font-size: 0.9rem;
}

/* Sound test dialog styling */
.ldr-sound-test-dialog {
  font-size: 0.9rem;
}

.ldr-sound-test-content {
  display: flex;
  flex-direction: column;
}

.ldr-sound-test-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.ldr-sound-test-content ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.ldr-sound-test-content li {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.ldr-sound-test-content .ldr-test-tip {
  background-color: rgba(64, 191, 255, 0.1);
  border-radius: 6px;
  padding: 10px;
  margin: 10px 0;
  font-size: 0.85rem;
}

.ldr-sound-test-content button {
  margin-top: 10px;
  margin-right: 8px;
}

/* History List */
.ldr-history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ldr-history-item {
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.ldr-history-item:hover {
  border-color: var(--accent-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ldr-history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ldr-history-item-title {
  font-weight: 500;
  color: var(--text-primary);
}

.ldr-history-item-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.ldr-status-completed {
  background-color: rgba(10, 207, 151, 0.15);
  color: var(--success-color);
}

.ldr-status-in-progress {
  background-color: rgba(64, 191, 255, 0.15);
  color: var(--accent-tertiary);
  animation: pulse 2s infinite;
}

.ldr-status-failed {
  background-color: rgba(250, 92, 124, 0.15);
  color: var(--error-color);
}

.ldr-status-suspended {
  background-color: rgba(243, 156, 18, 0.15);
  color: #ffc107;
}

.ldr-status-terminating {
  background-color: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.ldr-history-item-meta {
  display: flex;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.ldr-history-item-date {
  margin-right: 1rem;
}

.ldr-history-item-mode {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ldr-history-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  position: relative;
  z-index: 5;
}

.ldr-history-item-actions button {
  position: relative;
  z-index: 10;
}

/* Results Page */
.ldr-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ldr-results-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.ldr-metadata-item {
  display: flex;
  flex-direction: column;
}

.ldr-metadata-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  opacity: 1 !important;
}

.ldr-metadata-value {
  color: var(--text-primary);
  font-weight: 500;
}

.ldr-results-content {
  line-height: 1.7;
}

.ldr-results-content h1 {
  font-size: 1.75rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-primary);
}

.ldr-results-content h2 {
  font-size: 1.5rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--accent-tertiary);
}

.ldr-results-content h3 {
  font-size: 1.25rem;
  margin: 1rem 0 0.5rem;
  color: var(--accent-secondary);
}

.ldr-results-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.ldr-results-content ul,
.ldr-results-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.ldr-results-content li {
  margin-bottom: 0.5rem;
}

.ldr-results-content code {
  background-color: var(--bg-tertiary);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.ldr-results-content pre {
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.ldr-results-content blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.ldr-results-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.ldr-results-content th {
  background-color: var(--bg-tertiary);
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  color: var(--accent-tertiary);
}

.ldr-results-content td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Research Details Page */
.ldr-research-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.ldr-detail-progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ldr-detail-progress-bar {
  flex: 1;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.ldr-detail-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.ldr-research-log-container {
  margin-top: 1.5rem;
}

.ldr-research-log-container h3 {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

.ldr-research-log {
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.ldr-log-entry {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
}

.ldr-log-entry:last-child {
  border-bottom: none;
}

.ldr-log-entry-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 80px;
}

.ldr-log-entry-content {
  flex: 1;
}

.ldr-log-entry-message {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.ldr-log-entry-progress {
  font-size: 0.85rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

.ldr-detail-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.ldr-phase-highlight {
  color: var(--accent-tertiary);
  font-weight: 500;
}

.ldr-phase-init {
  color: var(--accent-tertiary);
}

.ldr-phase-search {
  color: var(--accent-secondary);
}

.ldr-phase-analysis {
  color: var(--warning-color);
}

.ldr-phase-complete {
  color: var(--success-color);
}

.ldr-phase-error {
  color: var(--error-color);
}

.ldr-phase-termination {
  color: #e74c3c;
  font-weight: bold;
}

.ldr-empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.ldr-error-message {
  padding: 1rem;
  background-color: rgba(250, 92, 124, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 8px;
  color: var(--error-color);
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* Loading Spinner */
.ldr-loading-spinner {
  padding: 2rem 0;
}

.ldr-loading-spinner.ldr-centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ldr-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(110, 79, 246, 0.2);
  border-left-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Tab Bar */
.ldr-mobile-tab-bar {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.ldr-mobile-tab-bar ul {
  display: flex;
  height: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.ldr-mobile-tab-bar li {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  padding: 0.5rem 0;
  min-width: 90px;
}

.ldr-mobile-tab-bar li i {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.ldr-mobile-tab-bar li span {
  font-size: 0.75rem;
  text-align: center;
  width: 100%;
}

.ldr-mobile-tab-bar li.active {
  color: var(--accent-primary);
}

.ldr-mobile-tab-bar li:hover {
  color: var(--text-primary);
}

/* External link styling for sidebar and mobile navigation - more subtle */
.ldr-sidebar-nav ul li.ldr-external-link {
    color: var(--text-primary);
    border-left: 3px solid #607d8b;
    margin-bottom: 10px;
    padding-left: 17px;
    opacity: 0.75;
}

.ldr-sidebar-nav ul li.ldr-external-link:hover {
    background-color: rgba(96, 125, 139, 0.1);
    opacity: 1;
    cursor: pointer;
}

.ldr-mobile-tab-bar ul li.ldr-external-link {
    color: var(--text-primary);
    opacity: 0.75;
}

.ldr-mobile-tab-bar ul li.ldr-external-link i {
    color: var(--text-primary);
}

.ldr-mobile-tab-bar ul li.ldr-external-link:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 991px) {
  .ldr-sidebar {
    width: 60px;
    overflow: hidden;
  }

  /* Adjust top bar position for narrow sidebar */
  .ldr-top-bar {
    left: 60px;
  }

  /* Hide all text in the logo and center icon */
  .ldr-sidebar-header {
    padding: 1rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
  }

  .ldr-sidebar-header h2 {
    font-size: 0;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .ldr-sidebar-header h2 i {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide all text in nav items and center icons */
  .ldr-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
  }

  .ldr-sidebar-nav ul {
    width: 100%;
  }

  .ldr-sidebar-nav li {
    text-indent: -9999px;
    white-space: nowrap;
    text-align: center;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ldr-sidebar-nav li a {
    padding: 1rem 0;
  }

  .ldr-sidebar-nav li i {
    text-indent: 0;
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide navigation shortcuts on small screens */
  .ldr-nav-shortcut {
    display: none;
  }

  /* Hide section labels in icon-only mode */
  .ldr-sidebar-section-label {
    display: none;
  }

  /* Reduce section spacing in icon-only mode */
  .ldr-sidebar-section {
    margin-bottom: 0.5rem;
  }

  /* Hide nav text in icon-only mode */
  .ldr-nav-text {
    display: none;
  }

  /* Active state fix for icon view */
  .ldr-sidebar-nav li.active {
    border-left-width: 3px;
  }

  /* Hide footer */
  .ldr-sidebar-footer {
    display: none;
  }

  /* Adjust main content */
  .ldr-main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
  }

  .ldr-mode-selection {
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: 60px; /* Add padding to body for the tab bar */
  }

  /* Override flex container to not show sidebar */
  .ldr-app-container {
    display: block !important;
  }

  /* Hide desktop sidebar completely on mobile */
  aside.ldr-sidebar,
  .ldr-sidebar:not(.active) {
    display: none !important;
    visibility: hidden !important;
  }

  .ldr-main-content {
    margin-left: 0;
    width: 100%;
    padding-bottom: 70px; /* Account for mobile tab bar */
  }

  /* Adjust top bar for mobile */
  .ldr-top-bar {
    left: 0;
    padding: 0 1rem;
    height: 50px;
  }

  .ldr-user-info {
    font-size: 0.85rem;
  }

  .ldr-logout-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Adjust padding for mobile when log panel is visible */
  .ldr-page#research-progress.active ~ .ldr-main-content,
  .ldr-page#research-results.active ~ .ldr-main-content {
    padding-bottom: calc(42vh + 60px); /* Log panel + mobile tab bar */
  }

  /* Sidebar toggle for mobile menu (hamburger menu) - only show when explicitly activated */
  .ldr-sidebar.active {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
    z-index: 1100;
    background-color: var(--bg-secondary);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  /* Overlay/backdrop for mobile sidebar */
  .ldr-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    transition: opacity 0.3s ease-in-out;
  }

  .ldr-sidebar-overlay.active {
    display: block;
  }

  /* Restore text in logo when sidebar is active on mobile */
  .ldr-sidebar.active .ldr-sidebar-header h2 {
    font-size: 1.25rem;
  }

  /* Show section labels when sidebar is active on mobile */
  .ldr-sidebar.active .ldr-sidebar-section-label {
    display: block;
  }

  /* Show nav text when sidebar is active on mobile */
  .ldr-sidebar.active .ldr-nav-text {
    display: block;
  }

  /* Restore text in nav items when sidebar is active on mobile */
  .ldr-sidebar.active .ldr-sidebar-nav li {
    text-indent: 0;
    text-align: left;
  }

  .ldr-sidebar.active .ldr-sidebar-nav li a {
    padding: 0.75rem 1.5rem;
  }

  .ldr-sidebar.active .ldr-sidebar-nav li i {
    display: inline;
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
  }

  .ldr-sidebar.active .ldr-sidebar-footer {
    display: flex;
  }

  /* Show mobile tab bar */
  .ldr-mobile-tab-bar {
    display: flex !important; /* Use !important to ensure it displays */
  }

  /* Ensure main content doesn't overlap with sidebar */
  .ldr-page {
    position: relative;
    z-index: 1;
  }

  /* Ensure forms and inputs are accessible */
  #research-form,
  #query {
    position: relative;
    z-index: 1;
  }
}

.ldr-progress-status {
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
  font-weight: 500;
}

.ldr-progress-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* File path styling from the first version */
.ldr-file-path {
  background-color: #1a1a1a;
  padding: 10px;
  border-radius: 4px;
  font-family: monospace;
  margin: 15px 0;
  word-break: break-all;
  border: 1px solid #333;
}

.ldr-config-example {
  background-color: #0a0a0a;
  padding: 15px;
  border-radius: 4px;
  font-family: monospace;
  margin: 15px 0;
  overflow-x: auto;
  border: 1px solid #333;
  color: #e6e6e6;
}

.mt-4 {
  margin-top: 20px;
}

/* Try again button styling from the second version */
#try-again-btn {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#try-again-btn:hover {
  background-color: #2980b9;
}

#try-again-btn i {
  margin-right: 5px;
}

/* Collapsible Log Panel styles from the third version */
.ldr-collapsible-log-panel {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    padding: 0;
    margin: 0;
    /* Instead of hiding, make it visible by default */
    display: flex;
}

/* Updated selector to ensure it's visible when needed */
.ldr-page#research-progress.active ~ .ldr-collapsible-log-panel,
.ldr-page#research-results.active ~ .ldr-collapsible-log-panel,
.ldr-page#research-progress .ldr-collapsible-log-panel,
.ldr-page#research-results .ldr-collapsible-log-panel {
    display: flex !important; /* Force display with !important */
}

/* Adjust for smaller screens */
@media (max-width: 991px) {
    .ldr-collapsible-log-panel {
        left: 60px; /* Adjust for collapsed sidebar */
    }
}

@media (max-width: 767px) {
    .ldr-collapsible-log-panel {
        left: 0; /* Full width on mobile */
        bottom: 60px; /* Account for mobile tab bar */
    }
}

.ldr-log-panel-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gradient-bg);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    z-index: 101;
    border-radius: 8px 8px 0 0;
}

.ldr-log-panel-header:hover {
    background-color: var(--bg-secondary);
}

.ldr-log-panel-header .ldr-toggle-icon {
    margin-right: 0.75rem;
    transition: transform 0.3s ease;
}

.ldr-log-panel-header.collapsed .ldr-toggle-icon {
    transform: rotate(-90deg);
}

.ldr-log-indicator {
    margin-left: auto;
    background-color: var(--accent-primary);
    color: white;
    border-radius: 12px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    min-width: 1.5rem;
    text-align: center;
}

.ldr-log-panel-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease;
}

.ldr-log-panel-content.collapsed {
    height: 0 !important;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: none;
}

.ldr-log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.ldr-log-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ldr-log-filter select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.ldr-console-log {
    padding: 0.5rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-y: auto;
    height: 100%;
}

.ldr-console-log-entry {
    padding: 0.5rem;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ldr-console-log-entry:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.ldr-console-log-entry .ldr-log-timestamp {
    color: var(--text-muted);
    min-width: 4.5rem;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.ldr-console-log-entry .ldr-log-badge {
    display: inline-block;
    padding: 0 0.4rem;
    margin-right: 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    line-height: 1.4;
}

.ldr-console-log-entry .ldr-log-message {
    flex: 1;
    word-break: break-word;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* Duplicate counter badge for logs */
.ldr-console-log-entry .ldr-duplicate-counter {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    display: inline-block;
}

.ldr-console-log-entry.ldr-log-milestone .ldr-log-badge {
    background-color: var(--accent-primary);
    color: white;
}

.ldr-console-log-entry.ldr-log-error .ldr-log-badge {
    background-color: var(--error-color);
    color: white;
}

.ldr-console-log-entry.ldr-log-warning .ldr-log-badge {
  background-color: var(--warning-color);
  color: white;
}

.ldr-console-log-entry.ldr-log-debug .ldr-log-badge {
  background-color: var(--text-muted);
  color: white;
}

.ldr-console-log-entry.ldr-log-info .ldr-log-badge {
    background-color: var(--accent-tertiary);
    color: white;
}

.ldr-empty-log-message {
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
    font-style: italic;
}

/* Add warning message styling */
.ldr-warning-message {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.2);
}

/* Styling for search engine selection log entries */
.ldr-console-log-entry[data-log-type="info"][data-engine-selected="true"] {
    background-color: rgba(64, 191, 255, 0.05);
    border-left: 2px solid var(--accent-tertiary);
    padding-left: calc(0.5rem - 2px);
    font-weight: 500;
}

.ldr-console-log-entry[data-log-type="info"][data-engine-selected="true"] .ldr-log-message {
    color: var(--accent-tertiary);
}

/* Update existing error message styling if needed */
.ldr-error-message {
    display: none;
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 4px solid;
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.2);
    font-weight: 500;
}

.ldr-filter-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    margin-top: 0;
}

.ldr-small-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ldr-small-btn:hover {
    background-color: rgba(110, 79, 246, 0.2);
    color: var(--text-primary);
}

.ldr-small-btn.ldr-selected {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Settings card styles */
.ldr-settings-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

.ldr-settings-card:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.ldr-settings-card .btn {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.ldr-settings-card .btn:hover {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Search Controls */
.ldr-search-controls {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.ldr-search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.ldr-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 79, 246, 0.2);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ldr-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-left: 4px solid transparent;
}

.ldr-toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.ldr-toast i {
    font-size: 1.2rem;
}

.ldr-toast-success {
    border-left-color: var(--success-color);
}

.ldr-toast-success i {
    color: var(--success-color);
}

.ldr-toast-error {
    border-left-color: var(--error-color);
}

.ldr-toast-error i {
    color: var(--error-color);
}

.ldr-toast-info {
    border-left-color: var(--accent-tertiary);
}

.ldr-toast-info i {
    color: var(--accent-tertiary);
}

.ldr-toast-warning {
    border-left-color: var(--warning-color);
}

.ldr-toast-warning i {
    color: var(--warning-color);
}

/* Advanced Options */
.ldr-advanced-options-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 1.5rem 0 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--accent-tertiary);
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 8px;
    background-color: rgba(64, 191, 255, 0.05);
    border: 1px solid rgba(64, 191, 255, 0.1);
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.ldr-advanced-options-toggle:hover {
    color: var(--accent-secondary);
    background-color: rgba(110, 79, 246, 0.1);
    border-color: rgba(110, 79, 246, 0.2);
}

.ldr-advanced-options-toggle .ldr-toggle-text {
    margin-right: 0.5rem;
}

.ldr-advanced-options-toggle i {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.ldr-advanced-options-toggle.ldr-open i {
    transform: rotate(180deg);
}

.ldr-advanced-options-panel {
    background-color: rgba(42, 42, 58, 0.5);
    border-radius: 8px;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Allow form controls to be interactive even when panel is collapsed */
.ldr-advanced-options-panel select,
.ldr-advanced-options-panel input,
.ldr-advanced-options-panel button,
.ldr-advanced-options-panel textarea {
    pointer-events: auto;
}

.ldr-advanced-options-toggle.ldr-open + .ldr-advanced-options-panel,
.ldr-advanced-options-panel.ldr-expanded {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 1.5rem;
}

.ldr-form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ldr-form-group.ldr-half {
    flex: 1;
}

.ldr-input-help {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.ldr-form-options {
    margin: 1.5rem 0;
}

.ldr-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ldr-checkbox-label:hover {
    background-color: rgba(64, 191, 255, 0.05);
}

.ldr-checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
}

/* Improved form controls for advanced options */
.ldr-form-control {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.ldr-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8aa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

input[type="number"].ldr-form-control {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"].ldr-form-control::-webkit-outer-spin-button,
input[type="number"].ldr-form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ldr-form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(110, 79, 246, 0.15);
}

/* Notification Group Styles from app-refactoring */
.ldr-notification-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ldr-notification-group .ldr-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ldr-notification-group .btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.ldr-notification-group .btn-sm:hover {
  background-color: var(--accent-primary);
  color: white;
}

/* Custom Dropdown Component */
.ldr-custom-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
    margin-bottom: 0.25rem;
}

.ldr-custom-dropdown-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
}

.ldr-custom-dropdown-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(110, 79, 246, 0.2);
}

.ldr-custom-dropdown-list {
    position: absolute;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    display: none;
    z-index: 1000;
    margin-top: 4px;
    box-shadow: var(--card-shadow);
}

.ldr-custom-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.ldr-custom-dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.ldr-custom-dropdown-item.active {
    background-color: rgba(110, 79, 246, 0.2);
}

.ldr-custom-dropdown-item .ldr-highlight {
    color: var(--accent-primary);
    font-weight: 500;
}

.ldr-custom-dropdown-no-results {
    padding: 8px 12px;
    color: var(--text-muted);
    font-style: italic;
}

.ldr-custom-dropdown-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    color: var(--accent-tertiary);
    font-size: 0.9em;
    background-color: rgba(110, 79, 246, 0.05);
}

.ldr-model-warning {
    color: var(--warning-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* Form Layout Helpers */
.ldr-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ldr-form-group.ldr-half {
    flex: 1;
    min-width: 250px; /* Minimum width before wrapping */
}

/* Three-column layout on large screens for advanced options */
@media (min-width: 1200px) {
    .ldr-advanced-options-panel .ldr-form-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .ldr-advanced-options-panel .ldr-form-group.ldr-half {
        min-width: unset;
    }

    /* Make the endpoint container span 2 columns when visible */
    .ldr-advanced-options-panel #endpoint_container.ldr-form-group {
        grid-column: span 2;
    }
}

/* Keep two-column on medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
    .ldr-advanced-options-panel .ldr-form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.ldr-input-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Star Rating Component */
.ldr-star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    font-size: 1.2rem;
}

.ldr-star-rating .ldr-star {
    color: #444;
    transition: color 0.2s ease;
    user-select: none;
    cursor: pointer;
}

.ldr-star-rating .ldr-star.active {
    color: #ffd700;
}

.ldr-star-rating .ldr-star.ldr-hover {
    color: #ffd700;
}

.ldr-metadata-item .ldr-star-rating {
    margin-left: 0.5rem;
}

/* History Page Enhancements */
.ldr-news-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.ldr-news-indicator i {
    font-size: 0.875rem;
}

.ldr-subscribe-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    transition: all 0.2s ease;
}

.ldr-subscribe-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

.ldr-subscribe-btn.ldr-subscribed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    cursor: default;
}

.ldr-subscribe-btn.ldr-subscribed:hover {
    transform: none;
}

/* Feedback Modal Options */
.ldr-feedback-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ldr-feedback-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.ldr-feedback-option:hover {
    background: rgba(110, 79, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    text-decoration: none;
}

.ldr-feedback-option i {
    font-size: 1.5rem;
    color: var(--accent-primary);
    width: 2rem;
    text-align: center;
}

.ldr-feedback-option strong {
    display: block;
    margin-bottom: 0.25rem;
}

.ldr-feedback-option small {
    color: var(--text-muted);
}

/* Sidebar Footer Links */
.ldr-sidebar-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.ldr-sidebar-links a {
    color: var(--text-muted);
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}

.ldr-sidebar-links a:hover {
    color: var(--accent-tertiary);
    opacity: 1;
}
